package dao;

import javabean.House;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.junit.Test;

import java.util.List;

public interface AnnotationDao {
    @Select("select * from house")
    List<House> findAll();

    @Select("select * from house where id=#{id}")
    House findOne(Integer id);

    @Insert("insert into house values(null,#{name},#{tel},#{address},#{rent},#{state})")
    void insert(House house);

    @Update("update house set name=#{name} where id=#{id}")
    void update(House house);

    @Delete("delete from house where id=#{id}")
    void delete(Integer id);

}
